/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import entity.Iphone;
import entity.Ipod;
import java.util.ArrayList;
import javax.management.Query;

/**
 *
 * @author Turtle
 */
public class ProductDAO {
    public static ArrayList<String[]> getProductList() {
        ArrayList<String[]> type = new ArrayList<String[]>();
        
        ArrayList<Ipod> ipods = IpodDAO.getProductList();
        ArrayList<Iphone> iphones = IphoneDAO.getProductList();
        
        for (int i = 0; i < ipods.size(); i++){
            String[] info = new String[2];
            
            info[0] = ipods.get(i).getName();
            info[1] = ipods.get(i).getProductid();
            
            type.add(info);
        }
        
        for (int i = 0; i < iphones.size(); i++){
            String[] info = new String[2];
            
            info[0] = iphones.get(i).getName();
            info[1] = iphones.get(i).getProductId();
            
            type.add(info);
        }

        return type;
    }
}
